﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace WindowsGame2
{
    class Botao
    {
        public Rectangle area;
        public string name;

        public Botao(int _x, int _y, int _sizeX, int _sizeY, string _name)
        {
            area = new Rectangle(_x, _y, _sizeX, _sizeY);
            name = _name;
        }

        public bool detectClick(int _x, int _y)
        {
            Rectangle click = new Rectangle(_x, _y, 1, 1);
            if(click.Intersects(area))
                return true;
            return false;
        }

        public void draw(SpriteBatch spriteBatch, Texture2D texture, SpriteFont font)
        {
            spriteBatch.Draw(texture, area, Color.LightGray);
            spriteBatch.DrawString(font, name, new Vector2(area.X + 5, area.Y + 2), Color.Black);
        }
    }
}
